home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / misc / gms_dev.lha / GMSDev / Source / AMOS / Pixels / PixelTrial3.s < prev   
Encoding:
Text File  |  1980-01-11  |  1.7 KB  |  121 lines

  1. '
  2. ' Pixel Trail code by Peter Cahill, September 98
  3. '
  4. '
  5. ' TGE demonstration......
  6.  
  7.  
  8.  
  9.  
  10.  
  11. Set Buffer 10000
  12. Amos To Back 
  13. AMTPIXELS=20
  14. Timer=0
  15. Dim X(AMTPIXELS),Y(AMTPIXELS),C(AMTPIXELS),STX(50000),STY(50000)
  16.  
  17. G Load Iff "gmsdev:logos/gmslogo-fullscreen.iff",0
  18.  
  19.  
  20. Do 
  21.    MX=G X Mouse
  22.    MY=G Y Mouse
  23. MY=MY+Rnd(10)
  24.  
  25.    STX(POZ)=MX
  26.    STY(POZ)=MY
  27.    Inc POZ
  28.    If POZ=49999 Then Exit 
  29.  
  30.    
  31.    'Update Pixels 
  32.    
  33.    For LOP=1 To AMTPIXELS
  34.       If C(LOP)<>0
  35.          G Plot X(LOP),Y(LOP),C(LOP)
  36.          
  37.          C(LOP)=C(LOP)-1
  38.  
  39.          Y(LOP)=Y(LOP)+2
  40.          
  41.       Else 
  42.          FREPIXEL=LOP
  43.       End If 
  44.       
  45.    Next LOP
  46.    X(FREPIXEL)=MX
  47.    
  48.    Y(FREPIXEL)=MY
  49.    
  50.    C(FREPIXEL)=16 : Rem                               brightest colour 
  51.    
  52.    G Plot X(FREPIXEL),Y(FREPIXEL),C(FREPIXEL)
  53.    G Update 
  54.  
  55.    If G Left Click=True Then Exit 
  56.  
  57. Loop 
  58.  
  59. '
  60. ' Re Draw exerything, the same way to how the user drew it above.
  61. '
  62. '
  63.  
  64.  
  65. For A=1 To AMTPIXELS
  66. X(A)=0 : Y(A)=0 : C(A)=0
  67. Next A
  68.  
  69.  
  70. G Screen Close 0
  71. G Update 
  72.  
  73.  
  74. G Load Iff "gmsdev:logos/gmslogo-fullscreen.iff",0
  75. Wait 100
  76. POZ=0
  77. Do 
  78.    MX=G X Mouse : Rem           *** these are not needed, but retain the same speed
  79.    MY=G Y Mouse
  80.    MX=STX(POZ)
  81.    MY=STY(POZ)
  82.    Inc POZ
  83.    If POZ=49999 Then Exit 
  84.  
  85.    
  86.    'Update Pixels 
  87.    
  88.    For LOP=1 To AMTPIXELS
  89.       If C(LOP)<>0
  90.          G Plot X(LOP),Y(LOP),C(LOP)
  91.          C(LOP)=C(LOP)-1
  92.          Y(LOP)=Y(LOP)+2
  93.          
  94.       Else 
  95.          FREPIXEL=LOP
  96.       End If 
  97.    Next LOP
  98.    X(FREPIXEL)=MX
  99.    Y(FREPIXEL)=MY
  100.    C(FREPIXEL)=16 : Rem                               brightest colour 
  101.    
  102.    G Plot X(FREPIXEL),Y(FREPIXEL),C(FREPIXEL)
  103.    G Update 
  104.  
  105.    If G Left Click=True Then Exit 
  106. Loop 
  107.  
  108.  
  109. G Screen Close 0
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.